home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / RCS / abs.c,v < prev    next >
Encoding:
Text File  |  1989-03-22  |  1.6 KB  |  89 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     89.03.22.00.46.50;  author rab;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     88.05.21.12.14.46;  author ouster;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @*** empty log message ***
  27. @
  28. text
  29. @/* 
  30.  * abs.c --
  31.  *
  32.  *    Contains the source code for the "abs" library procedure.
  33.  *
  34.  * Copyright 1988 Regents of the University of California
  35.  * Permission to use, copy, modify, and distribute this
  36.  * software and its documentation for any purpose and without
  37.  * fee is hereby granted, provided that the above copyright
  38.  * notice appear in all copies.  The University of California
  39.  * makes no representations about the suitability of this
  40.  * software for any purpose.  It is provided "as is" without
  41.  * express or implied warranty.
  42.  */
  43.  
  44. #ifndef lint
  45. static char rcsid[] = "$Header: /sprite/src/lib/c/stdlib/RCS/abs.c,v 1.1 88/05/21 12:14:46 ouster Exp Locker: rab $ SPRITE (Berkeley)";
  46. #endif /* not lint */
  47.  
  48. #include <stdlib.h>
  49.  
  50. /*
  51.  *----------------------------------------------------------------------
  52.  *
  53.  * abs --
  54.  *
  55.  *    Compute the absolute value of an integer.
  56.  *
  57.  * Results:
  58.  *    The return value is j, unless j is negative, in which case
  59.  *    the return value is -j.
  60.  *
  61.  * Side effects:
  62.  *    None.
  63.  *
  64.  *----------------------------------------------------------------------
  65.  */
  66.  
  67. int
  68. abs(j)
  69.     int j;            /* Value to take the absolute value of. */
  70. {
  71.     if (j >= 0) {
  72.     return j;
  73.     }
  74.     return -j;
  75. }
  76. @
  77.  
  78.  
  79. 1.1
  80. log
  81. @Initial revision
  82. @
  83. text
  84. @d17 4
  85. a20 2
  86. static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
  87. #endif not lint
  88. @
  89.